﻿using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CYLScheck.UIcomm
{
    public partial class LoginFrm : UIForm
    {
        private Declosedmainform DeCloseMainFrm;
        public LoginFrm(Declosedmainform DeCLoseMForm)
        {
            InitializeComponent();
            DeCloseMainFrm = DeCLoseMForm;
            

        }
           string user = "没找到用户名";
            string password = "";
        private void LoginFrm_Load(object sender, EventArgs e)
        {
            this.Style = Gobleset.Gobel_userstyle;

            loadsetting.load_databaseconstring();
           
            user = Gobleset.username;
          
            password = Gobleset.userpassword;
           
        }

        private void uiSButton_ok_Click(object sender, EventArgs e)
        {
            if (uiTextBox_user.Text.Trim()==user&&uiTextBox_password.Text.Trim() == password)
            {
             
               this.Dispose();
                this.Close();
                return;
            }
            ShowErrorTip("用户账号或密码错误！");
            //ShowErrorTip("用户账号或密码错误！",2000,true);
        }

        private void uiSButton_cancel_Click(object sender, EventArgs e)
        {
            DeCloseMainFrm();
        }
    }
}
